import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { UserComponent } from "app/ui/user/user.component";
import { LoginComponent } from "app/ui/login/login.component";
import { Menu1Component } from "app/ui/menu1/menu1.component";
import { Menu2Component } from "app/ui/menu2/menu2.component";

const routes: Routes = [
  {
    path: '',
    redirectTo: 'user',
    pathMatch: 'full'
  },
  {
    path: 'user',
    component: UserComponent,
    children: [
      {
        path: '',
        redirectTo: 'menu1',
        pathMatch: 'full'
      },
      {
        path: 'menu1',
        component: Menu1Component
      },
      {
        path: 'menu2',
        component: Menu2Component
      },
      // {
      //   path: 'list',
      //   component: UserListComponent
      // }
    ]
  },
  {
    path: 'login',
    component: LoginComponent,
  },
]

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
